package com.freesky.provider.content.controller;

import com.freesky.common.dao.entity.HomeRotationChart;
import com.freesky.common.enums.PanelPositionEnum;
import com.freesky.common.pojo.DataTablesResult;
import com.freesky.common.pojo.ZTreeNode;
import com.freesky.common.utils.reponse.JSONResponse;
import com.freesky.common.dao.entity.PanelContent;
import com.freesky.provider.content.service.ICommonService;
import com.freesky.provider.content.service.IHomeRotationChartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author: 陈玉林
 * @modifiedBy:
 * @date: Create In 17:51 2018/12/12
 * @description:
 */
@RestController
public class HomeRotationChartController {

    @Autowired
    private IHomeRotationChartService homeRotationChartService;

    @PostMapping(value = "/home/rotation-chart/add")
    public JSONResponse add(@RequestBody HomeRotationChart rotationChart) {
        return homeRotationChartService.add(rotationChart);
    }


    @PostMapping(value = "/home/rotation-chart/update")
    public JSONResponse update(@RequestBody HomeRotationChart rotationChart) {
        return homeRotationChartService.update(rotationChart);
    }

    @DeleteMapping(value = "/home/rotation-chart/del/{ids}")
    public JSONResponse delete(@PathVariable("ids") int[] ids) {
        return homeRotationChartService.delete(ids);
    }

    @GetMapping(value = "/home/rotation-chart/portal/list")
    public JSONResponse portalList() {
        return homeRotationChartService.portalList();
    }
}
